#ifndef EDITORCORE_PROPERTYCHANGEACTION_H
#define EDITORCORE_PROPERTYCHANGEACTION_H

#include "Common/Collections/Vector.h"
#include "EditorCore/Actions/Action.h"

namespace editor_core {

	class ListAction : public Action
	{
	public:
		ListAction();
		virtual ~ListAction();

		void AddAction( IAction* action );
		void RemoveAction( IAction* action );
		void GetActions( cmn::ICollection<IAction*>& actions ) const;

		virtual ActionType GetType() const;

	protected:
		virtual bool Commit();
		virtual void Recommit();
		virtual void Rollback();

	private:
		int TryCommit();
		void RollbackFrom( int index );

		cmn::Vector<IAction*> m_list;
		bool m_listIsFinalized;
	};
}

#endif
